//
// Created by JYL on 2023-11-07.
//
#include "key.h"

#define KB1         HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_0)
#define KB2         HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1)
#define KB3         HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_2)
#define KB4         HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0)
#define KEY_PORT    (KB1|KB2<<1|KB3<<2|KB4<<3|0xf0)

uint8_t Trg;
uint8_t Cont;
void Key_Read(void )
{
    uint8_t ReadData = KEY_PORT^0xff;
    Trg = ReadData & (ReadData ^ Cont);
    Cont = ReadData;
}
